<?php
include("../lib/db.lib");
include("../lib/std.lib");
include("user_check.php");

$cat_id=param('cat_id');
$shop_id=3;

$other_field= cat_get_other($shop_id,$cat_id);


if(preg_match("/SHOW:/",$other_field)){

	if(param("show_on_off")=="on")
	$new_other_field=preg_replace("/SHOW:(ON|OFF)/","SHOW:ON",$other_field);
	if(param("show_on_off")=="off")
	$new_other_field=preg_replace("/SHOW:(ON|OFF)/","SHOW:OFF",$other_field);
	
	cat_set_other($shop_id,$cat_id,$new_other_field);
}
else
{

		if(param("show_on_off")=="on") $append="SHOW:ON";
		if(param("show_on_off")=="off") $append="SHOW:OFF";

		cat_append_other($shop_id,$cat_id,$append);
	
}
$title=cat_get_title($shop_id,$cat_id);
$p_id=cat_get_parent($shop_id,$cat_id);
redirect("Catalog $cat_id: <i>$title</i>  updated : $append ","./p_cat_show.php?cat_id=$p_id");

?>
